<template>
<div>
  <el-row class="ca-m-t-20">
    <el-col :span="12" class="ca-title">
      <h3 class="inline-block">相关文档</h3>
      <!-- <csUploadBtn class="inline-block left20" :businessId="businessId" :fileType="fileType" :isShowFileChildType="false" uploadType="all" :getFileUploadedReturnData="getFileUploadedReturnDataFun"></csUploadBtn> -->
    </el-col>
  </el-row>
  <div class="ca-file-ul">
    <el-row class="ca-file-row ca-m-t-20" :gutter="20" v-for="(file, index) in myFileList" :key="index">
      <el-col :span="4" class="upload-time">{{$moment(file.uploadTime).format('YYYY-MM-DD')}}</el-col>
      <el-col :span="1">
        <tz-icon-file-type class="ca-m-r-5" :fileType="file.fileName"></tz-icon-file-type>
      </el-col>
      <el-col :span="8">
        <div class="ca-text-over-flow-ellipsis ca-pointer" @click="previewFileCheck(file.id, file.fileName)">
          <span class="ca-font-size-16 ca-pointer">{{file.fileName}}</span>
        </div>
      </el-col>
      <el-col :span="4">
        <div class="ca-text-over-flow-ellipsis">{{$store.state.user.cnName}}</div>
      </el-col>
      <el-col :span="3" class="ca-pull-right ca-align-right">
        <a class="ca-download ca-m-r-10" @click="downloadFile(file.id)"></a>
        <!-- <el-button class="ca-table-btn" @click="del(index)">
          <i class="fa fa-times"></i>
        </el-button> -->
      </el-col>
    </el-row>
    <el-row class="color999" v-if="myFileList.length==0">
      暂无数据
    </el-row>
  </div>
</div>
</template>

<script>
import mined from '__components/file-list/mixin';
export default {
  mixins: [mined],
  data() {
    return {
      myFileList: this.fileListBak,
      // fileIds: []
    }
  },
  props: {
    fileListBak: {
      type: Array,
      default: function () {
        return []
      }
    },
    fileType: {
      type: String,
      default: ''
    },
    businessId: {
      type: String,
      default: ''
    },
  },
  methods: {
    //文件上传成功返回的数据
    // getFileUploadedReturnDataFun(arr) {
    //     this.fileIds.push(arr[0].id)
    //     this.fileList.push(arr[0])
    //     this.$emit('getFileList',this.fileIds)
    // },
  },
  components: {
    'csUploadBtn': require('__components/upload-btn'),
  }
};
</script>

<style scoped>
.inline-block{
    display: inline-block;
}
.left20 {
  margin-left: 20px
}
</style>